<!DOCTYPE html>
<html lang="en">
<head>

    <title>文件上传</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="static/easyui/themes/default/easyui.css">
    <link href="static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
    <link href="static/easyui/demo/demo.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="static/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/js/main.js"></script>
</head>
<body  style="height: 100%">
<div class="container" >
    <div class="content">
        <div class="easyui-panel" style="padding:5px">
            请选择文件夹：<span id="folderPath"></span>
            <div style="margin-bottom:20px">
                <input class="easyui-combotree" data-options="url:'json/sidebar.json',method:'get',labelPosition:'top'" style="width:500px">
            </div>
            <div style="margin-bottom:20px">
                <input id="fb" type="text" style="width:300px">
            </div>
            <div style="margin-bottom:20px">
                请添加标签：<input class="easyui-tagbox" value="" style="width:200px">
            </div>
            <div class="btn-selection">
                <a href="javascript:submitForm();" class="easyui-linkbutton save-btn" data-options="selected:true">提交</a>
                <a href="javascript:void(0);" class="easyui-linkbutton reset-btn" data-options="selected:true">重置</a>
            </div>

        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $('#fb').filebox({
            buttonText: '选择文件',
            buttonAlign: 'left'
        })

        $("#folder-tree").tree({
            url: "json/sidebar.json",
            method: "get",
            animate: true,
            onContextMenu: function (e, node) {
                e.preventDefault();
                $(this).tree('select', node.target);
                console.log(e)
                if ("children" in node) {
                    $('#mm1').menu('show', {
                        left: e.pageX,
                        top: e.pageY
                    });
                } else {
                    $('#mm2').menu('show', {
                        left: e.pageX,
                        top: e.pageY
                    });
                }

            }
        })
    })

    function submitForm() {
        $.messager.alert("提示", "上传成功");
    }

</script>
</body>
</html>